#ifndef MEASUREMENT_H_
#define MEASUREMENT_H_

#include <sstream>

template <typename Unit>
struct Measurement;
template <typename Unit>
std::ostringstream& operator << (std::ostringstream& os, const Measurement<Unit>& measurement);

struct OutputStreamMethod;

template <typename Unit>
struct Measurement
{
    Measurement(unsigned int amount, const Unit* unit);

	bool operator == (const Measurement<Unit>& second) const;
	bool operator != (const Measurement<Unit>& second) const;

	Measurement<Unit> operator + (const Measurement<Unit>& second) const;
	Measurement<Unit> operator / (const Measurement<Unit>& second) const;
	Measurement<Unit> operator % (const Measurement<Unit>& second) const;

	friend std::ostringstream& operator << <> (std::ostringstream& os, const Measurement<Unit>& measurement);

	void outputStream(const OutputStreamMethod& outputMethod, std::ostringstream& os);
	bool empty();

private:
	explicit Measurement(unsigned int amountInBase);

	unsigned int amountInBase;
	unsigned int amount;
	const Unit*  unit;
};

#include "../src/Measurement.cc"

#endif
